package cn.lyz.authority.system.controller;

import cn.lyz.authority.common.vo.LyzResponseBody;
import cn.lyz.authority.system.entity.SysUser;
import cn.lyz.authority.system.service.ISysUserService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author wangxw
 * @since 2024-08-31
 */
@RestController
@RequestMapping("/system/user")
public class SysUserController {

    @Resource
    private ISysUserService sysUserService;

    @GetMapping("page")
    public LyzResponseBody<?> page(@RequestParam(defaultValue = "1") Integer current,@RequestParam(defaultValue = "10") Integer size){
        Page<SysUser> page = sysUserService.page(new Page<>(current, size));
        return LyzResponseBody.success(page);
    }

    @PostMapping()
    public String add(){

        return "OK";
    }
}
